package com.fierce.cloud.core.common.service;

import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author Fierce
 * @date 2020-12-31 16:38
 */
public interface Service<T> {
    void save(T model);

    void save(List<T> models);

    void deleteById(Integer id);

    void deleteById(Long id);

    void deleteById(String id);

    void deleteByExample(Example example);

    void deleteByCondition(Condition condition);

    void update(T model);

    T findById(Integer id);

    T findById(String id);

    T findById(Long id);

    T findOne(T model);

    List<T> findByCondition(Condition condition);//根据条件查找

    List<T> findByExample(Example example);//排序等复杂查询

    List<T> findAll();//获取所有

    int countByCondition(Condition condition);
}
